/*

Author   : chaos

FileName : file_inp.cpp

Date     : 16/08/17 11:30:40

*/
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;

#define FILEPATH "Reader.txt"

int main(int argc ,char *argv[])
{
    fstream file;
    char str[8];
    int id;

    file.open(FILEPATH,ios::in);

    if(!file)
    {
        cerr << "Can't open file! " << endl;
    }

    cout << setw(4) << setiosflags(ios::right) << "ID"
        <<setw(8) << setiosflags(ios::right) <<"Name" << endl;

    cout << "----------------------------------" << endl;
    while(file >> id >> str)
        cout << setw(4) << setiosflags(ios::right) << id
            <<setw(8) << setiosflags(ios::right) << str << endl;

    return 0;
}
